{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "df1ef996",
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "camera = cv2.VideoCapture(0)\n",
    "while True:\n",
    "    ok,image = camera.read() #从摄像头读取图片\n",
    "    canny = cv2.Canny(image,100,50) # 背景轮廓 细节轮廓\n",
    "    canny = 255 - canny # 取反\n",
    "    cv2.imshow('image-showing-window',image)\n",
    "    cv2.imshow('canny-showing-window',canny)\n",
    "    cv2.waitKey(40)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
